home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 8849 < prev    next >
Encoding:
Text File  |  1996-08-05  |  957 b   |  38 lines

  1. Path: news.bridge.net!news
  2. From: David Byrden <100101.2547@compuserve.com>
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Passing a type-specifier as an argument?!?
  5. Date: 27 Feb 1996 00:29:57 GMT
  6. Organization: self-employed
  7. Message-ID: <4gtja5$vuh@news.bridge.net>
  8. References: <rdk2-2602961506440001@dialin1-45.wustl.edu>
  9. NNTP-Posting-Host: ppp-mia2-68.bridge.net
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 1.1N (Windows; I; 16bit)
  14.  
  15.  
  16. >>>>>>>>
  17. #define _ones(t) _onesguts(t(0))
  18.  
  19. template <class T>
  20. T _onesguts(T n){
  21.    // stuff...
  22. }
  23.  
  24. What I would like to know is if there is a way to get around having to use
  25. a define to do  ones(int).  Any help is geatly appreciated...
  26. <<<<<<<<<<
  27.  
  28.  
  29.    I'm afraid not. The standard library itself passes around null pointers 
  30. internally as "type tags". But in the interest of good style, you should 
  31. drop the #define anyway.
  32.  
  33.  
  34.                              David
  35.  
  36.  
  37.  
  38.